from day01.basecla import BaseClass
from day01.basecla import driver
from selenium.webdriver.common.by import By
from time import sleep
c=BaseClass()
c.open_browser('file:///E:/%E8%93%AC%E8%8E%B1%E5%B0%8F%E8%AF%BE2024%E6%B5%8B%E8%AF%95/%E7%AC%AC%E5%9B%9B%E9%98%B6%E6%AE%B5/Selenium%E8%87%AA%E5%8A%A8%E5%8C%96/selenium_demo/day04demo/demo04.html')
print('当前标题:',driver.title)
print('当前地址:',driver.current_url)
link1=driver.find_element(By.XPATH,'//html/body/ul/li[1]/a')
link1.click()
sleep(2)
print('当前标题:',driver.title)
print('当前地址:',driver.current_url)
driver.back()
sleep(2)
link2=driver.find_element(By.XPATH,'//a[@href="demo02.html"]')
link2.click()
sleep(2)
driver.set_window_size(200,300)
driver.set_window_position(100,200)
sleep(2)
driver.maximize_window()
driver.back()
sleep(2)
link3=driver.find_element(By.XPATH,'/html/body/ul/li[3]/a')
link3.click()
sleep(2)
driver.minimize_window()
sleep(2)
c.close_browser()

